#ifndef EPUBDUKPT_CONTEXT_BASIC2_HPP
#define EPUBDUKPT_CONTEXT_BASIC2_HPP

SJR_NAMESPACE_BEGIN

class EpubContextBasic2 : public EpubContextBasic1 {
public:
  using Schedule = EpubCrypto::Schedule;

  EpubContextBasic2() : EpubContextBasic1(), mCrypto(EpubCrypto::TdesEcb) {}

  template<class... Args>
  auto createSchedule(Args... args) const -> Schedule * {
    return EpubCrypto::createSchedule(EpubCrypto::TdesEcb, args...);
  }

  void destroySchedule(Schedule *in) const {//NOLINT
    EpubCrypto::destroySchedule(in);
  }

  auto encrypt(Schedule *key, unsigned char const *in, unsigned char *out) -> bool {
    return mCrypto.encrypt(key, in, out);
  }

  auto decrypt(Schedule *key, unsigned char const *in, unsigned char *out) -> bool {
    return mCrypto.decrypt(key, in, out);
  }

private:
  EpubCrypto mCrypto;
};

SJR_NAMESPACE_END

#endif//EPUBDUKPT_CONTEXT_BASIC2_HPP
